# Maintainer: Florian Pritz <bluewind@xinu.at>
# Maintainer: T.J. Townsend <blakkheim@archlinux.org>
# Contributor: tobias <tobias@archlinux.org>
# Contributor: Tobias Kieslich <tobias@justdreams.de>
# Contributor: Firmicus <francois.archlinux.org>

pkgname=perl-image-exiftool
_srcname=Image-ExifTool
pkgver=12.70
pkgrel=2
pkgdesc="Reader and rewriter of EXIF information that supports raw files"
arch=('any')
url="https://exiftool.org/"
license=('GPL')
depends=('perl')
optdepends=('perl-archive-zip: Support for zip files, including epub'
            'perl-io-compress-brotli: Support for brotli-compressed metadata')
provides=("perl-exiftool=${pkgver}")
replaces=("perl-exiftool")
options=('!emptydirs')
source=(https://exiftool.org/${_srcname}-${pkgver}.tar.gz)
sha256sums=('4cb2522445cc3e3f3bd13904c6aeaeada5fc5a5e2498d7abad2957dcb42caffe')

build() {
  cd "${_srcname}-${pkgver}"
  # install module in vendor directories.
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd "${_srcname}-${pkgver}"
  make test
}

package() {
  cd "${_srcname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  install -dm755 "${pkgdir}/usr/share/${pkgname}"
  cp -r fmt_files config_files arg_files "${pkgdir}/usr/share/${pkgname}"
}
